﻿<%@ Page Language="C#" MasterPageFile="~/Management.master" AutoEventWireup="true" CodeFile="preventiveView.aspx.cs" Inherits="preventiveView" Title="Untitled Page" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc2" %>

<%@ Register Assembly="EclipseWebSolutions.DatePicker" Namespace="EclipseWebSolutions.DatePicker"
    TagPrefix="ews" %>
<%@ Register assembly="StrengthControls.Scrolling" namespace="StrengthControls.Scrolling" tagprefix="cc1" %>


<asp:Content ID="Content1" ContentPlaceHolderID="m_contentBody" Runat="Server">
   
    <body  onload ="TabbedPanels1.showPanel(<%=GetTabIndex()%>)">
    
         <asp:TextBox ID="txtHiddenPlanningId" runat="server" Height="100%" Width="100%" 
            Visible="False"></asp:TextBox>                          
    <div id="containerright" class="containerright">
          <div id="TabbedPanels1" class="TabbedPanels">
                <ul class="TabbedPanelsTabGroup">
                  <li class="TabbedPanelsTab" tabindex="0">List preventive</li>
                  <li class="TabbedPanelsTab" tabindex="1">Preventive detail</li>
                  <li class="TabbedPanelsTab" tabindex="1">Preventive add</li>
                  
                </ul>
              <div class="TabbedPanelsContentGroup" >

                  <div class="TabbedPanelsContent">
                   

<table  class="GridItem" cellspacing="2" cellpadding="2" style="width:auto;height:350">
    <tr>
        <td class="BigLabel" >
            <asp:Label Width="100%" Height="100%" ID="lblTotalEquipment" runat="server"></asp:Label>
            
       <%-- width="100%" Height="300px" --%>
        </td>
        </tr>
        
  <tr><td>
                 <asp:GridView ID="grdGroupeSoftware1" runat="server" 
        AllowPaging="True" Width="750px" 
                     AutoGenerateColumns="False"  Visible ="False" DataSourceID="dsMessage" 
                     
                     CellPadding="4" ForeColor="#333333" GridLines="None" PageSize="3">
                 <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                 <RowStyle BackColor="#EFF3FB" />
                 <Columns>
                     <asp:BoundField DataField="Label" />
                 </Columns>
             
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                   <RowStyle BackColor="#EFF3FB" />
                   <SelectedRowStyle BackColor="#FF5050" />
                   <HeaderStyle BorderStyle="None" CssClass="GridViewHeader" Height="20px" 
                        Width="30px" />
                        
                    <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <EditRowStyle BackColor="LightGray" />
                    <RowStyle CssClass="AlternativeRowStyle" />
                    <AlternatingRowStyle BackColor="White" CssClass="AlternativeRowStyle" />
                    
                 
              </asp:GridView >
         </td></tr>      
  <tr>
  <td  align="center" class="GridItem"  style="text-align:center">
             
                 <asp:ObjectDataSource ID="dsMessage" runat="server" SelectMethod="GetMessage" 
                     TypeName="DirectService"></asp:ObjectDataSource>
             <br />
             </td>    
         </tr>    
        
        
        
 <tr><td>
<div style=" height:350px; width:auto; overflow:auto">
      <asp:GridView
         
            ID="grdEquipment" 
            runat="server" 
            AllowPaging="True" 
            AutoGenerateColumns="False" 
            OnPageIndexChanging="grdEquipment_PageIndexChanging" 
            AllowSorting="True" 
            onrowcancelingedit="grdEquipment_RowCancelingEdit" 
            onrowdatabound="grdEquipment_RowDataBound1" 
            DataSourceID="odsEquipment" 
            RowHeaderColumn="EquipmentId" CssClass="GridItem" BorderStyle="None" 
            onselectedindexchanged="grdEquipment_SelectedIndexChanged"
            onrowcommand="grdEquipment_RowCommand" 
            DataKeyNames="MaintenanceId" PageSize="8">
                <HeaderStyle BorderStyle="None" CssClass="GridViewHeader" Height="30px" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" >
                            <ItemStyle Width="50px" />
                        </asp:CommandField>
                        <%--<asp:TemplateField>
                            <ItemTemplate>
                               <a title="Detail" 
                                    
                                    href="preventiveView.aspx?detail=false&tabIndex=1&preventiveId=<%# DataBinder.Eval(Container.DataItem, "MAINTENANCEID") %>">
                                <img border="0" height="20" src="images/b_view.png" width="20"> </img></a>
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>--%>
                        
                         <asp:TemplateField>
                            <ItemTemplate>
                               <a title="Delete" 
                                    
                                    href="javascript:confirmDelete('preventiveView.aspx?delete=true&tabIndex=0&preventiveId=<%# DataBinder.Eval(Container.DataItem, "MAINTENANCEID")%>&pageIndex=<%=GetPageIndex()%>')">
                                <img border="0" height="15" src="images/del.png" width="15"> </img></a>
                            </ItemTemplate>
                           <ItemStyle Width="15px" />
                        </asp:TemplateField>
                        
                        
                        
                       
                        <asp:BoundField DataField="MAINTENANCEID" HeaderText="Preventive Nº" 
                            SortExpression="MAINTENANCEID">
                            <ItemStyle HorizontalAlign="Left" Width="80px" />
                        </asp:BoundField>
                        
                        <asp:BoundField DataField="TYPEEQUIPMENT" HeaderText="Type" 
                            SortExpression="TYPEEQUIPMENT">
                            <ItemStyle HorizontalAlign="Left" Width="80px" />
                        </asp:BoundField>
                        
                        <asp:BoundField DataField="BUILDING" HeaderText="Building" 
                            SortExpression="BUILDING">
                            <ItemStyle HorizontalAlign="Left" Width="80px" />
                        </asp:BoundField>
                         <asp:BoundField DataField="EMPLOYEENAME" HeaderText="IT Member" 
                            SortExpression="EMPLOYEENAME">
                            <ItemStyle HorizontalAlign="Left" Width="80px" />
                        </asp:BoundField>
                        
                         <asp:BoundField DataField="NUMBEROFMONTHS" HeaderText="Month" 
                            SortExpression="NUMBEROFMONTHS">
                            <ItemStyle HorizontalAlign="Left" Width="180px" />
                        </asp:BoundField>
                        
                        <asp:BoundField DataField="startdate" DataFormatString="{0:MM/dd/yyyy}" 
                            HeaderText="Date start" HtmlEncode="False" SortExpression="startdate">
                            <ItemStyle HorizontalAlign="Left" Width="80px" />
                        </asp:BoundField>
                          
                    </Columns>
        <PagerStyle HorizontalAlign="Center" 
            VerticalAlign="Middle" />
        <EditRowStyle BackColor="LightGray" />
        <RowStyle CssClass="AlternativeRowStyle" />
        <AlternatingRowStyle BackColor="White" CssClass="AlternativeRowStyle" />
    </asp:GridView>
</div>
<asp:Label ID="lblInformation" runat="server" ForeColor="Red"></asp:Label>
        </td>
    </tr>
    <tr>
        <td align="center" class="GridItem" >      
            <asp:UpdatePanel ID="updatePanelEquipment" runat="server">
            <ContentTemplate>
        
                <asp:ObjectDataSource ID="odsEquipment" runat="server" 
                    SelectMethod="GetPreventiveMaintenance" TypeName="WODirectService" 
                    onselected ="odsSparepart_Selected">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="txtHiddenWhereClause" Name="whereClause" 
                            PropertyName="Text" Type="String" />
                        
                    </SelectParameters>
                </asp:ObjectDataSource>
    <tr><td>
    <asp:TextBox ID="txtHiddenPageIndex" runat="server" Visible="False"></asp:TextBox>
    <a id="detailPosition"></a>
       <asp:TextBox ID="txtHiddenWhereClause" runat="server" Height="17px" Width="205px" Visible="False"></asp:TextBox>
       <asp:TextBox ID="txthiddenOrderbyClause" runat="server"  Width="77px" 
            Visible="False"></asp:TextBox>
            <Triggers>
            
                <asp:AsyncPostBackTrigger ControlID="txtHiddenWhereClause" EventName="TextChanged" />
                
            </Triggers>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="txthiddenOrderbyClause" EventName="TextChanged" />
            </Triggers>
        	    </ContentTemplate>
        	    </asp:UpdatePanel>
     
                   
         </td></tr>
         
         
         
         
        	   
         
    </table>
    
          
    
    
          </div>
                              
                <div class="TabbedPanelsContent" >
                        <iframe  class="FrameDimension" src="preventiveDetail.aspx?displayMode=<%=GetDisplayMode()%>&preventiveId=<%=txtHiddenPlanningId.Text%>"  frameborder="0" ></iframe></div><!--This content will be included not use Iframe when using dynamique programing-->
                 <div class="TabbedPanelsContent" >
                        <iframe  class="FrameDimension" src="preventiveAdd.aspx?displayMode=<%=GetDisplayMode()%>&preventiveId=<%=txtHiddenPlanningId.Text%>"  frameborder="0" ></iframe></div><!--This content will be included not use Iframe when using dynamique programing-->
                        
                  
                 
          </div>
    </div>
 </div>
 <script type="text/javascript">
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    
 </script>
 </body>
 
            
</asp:Content>

<asp:Content ID="Content2" runat="server" contentplaceholderid="conSearch">
   
&nbsp;
            <div class="AccordionPanel">
        	    <div class="AccordionPanelTab"><b class="contentcolor"><asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/indicator.png" />&nbsp;PREVENTIVE</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div>
        	    <div class="AccordionPanelContent">
        	    <div style="height:30px"></div>
        	     <div style="height:50px">
        	     
                        Equipment type : 
                        <asp:DropDownList ID="drlEquipmentType" runat="server" Height="20px" 
                          Width="195px" AppendDataBoundItems="True" 
                          DataTextField="EquipmentTypeLabel" DataValueField="EquipmentTypeId" 
                            DataSourceID="odsEquipmentType">
                                    <asp:ListItem Value="-1">--- Choose Equipment type ---</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsEquipmentType" runat="server" 
                    SelectMethod="GetEquipmentTypes" TypeName="Service.ReferenceDataService" 
                            OldValuesParameterFormatString="original_{0}">
                </asp:ObjectDataSource>
                                </div>
                                 <div style="height:50px">
        	     
                        Building : 
                        <asp:DropDownList ID="drlBuilding" runat="server" Height="20px" 
                          Width="195px" AppendDataBoundItems="True" 
                          DataTextField="BuildingLabel" DataValueField="BuildingLabel" 
                            DataSourceID="odsBuilding">
                                    <asp:ListItem Value="-1">--- Choose building ---</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsBuilding" runat="server" 
                    SelectMethod="GetBuildings" TypeName="Service.ReferenceDataService" 
                            OldValuesParameterFormatString="original_{0}">
                </asp:ObjectDataSource>
                                </div>
        	     <div style="height:50px">
        	     
                        IT member : 
                        <asp:DropDownList ID="drlEmployee" runat="server" Height="20px" 
                          Width="195px" AppendDataBoundItems="True" 
                          DataTextField="EmployeeName" DataValueField="EmployeeId" 
                            DataSourceID="odsITemployee">
                                    <asp:ListItem Value="-1">--- Choose Employee---</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsITemployee" runat="server" 
                    SelectMethod="GetAssignedEmployees" TypeName="Service.ReferenceDataService">
                </asp:ObjectDataSource>
                                </div>
                                
                                 <div style="height:50px">
        	     
                       Number of Month : 
                        <asp:DropDownList ID="drlMonth" runat="server" Height="20px" 
                          Width="195px" AppendDataBoundItems="True" 
                          DataTextField="NUMBEROFMONTHS" DataValueField="NUMBEROFMONTHS" 
                            DataSourceID="odsNumberMonthPreventive">
                                    <asp:ListItem Value="-1">--- Choose period of mantenance---</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsNumberMonthPreventive" runat="server" 
                    SelectMethod="GetNumberOfMonthsToDoPreventiveMantenance" TypeName="ReferenceDataDirectService">
                </asp:ObjectDataSource>
                                </div>
        	   
        	  
               
                                <div style="height:30px"> Start from: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:TextBox ID="txtStartDate" runat="server" Width="81px"></asp:TextBox>
            <asp:Image ID="imgCalendar" runat="server" ImageUrl="~/images/calendar.png" Width="16px" />
            <cc2:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtStartDate" PopupButtonID="imgCalendar">
            </cc2:CalendarExtender> 
                                </div>
                                
                                <div style="height:30px"> End to: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:TextBox ID="txtEndDate" runat="server" Width="81px"></asp:TextBox>
            <asp:Image ID="Image1" runat="server" ImageUrl="~/images/calendar.png" />
            <cc2:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtEndDate" PopupButtonID="Image1">
            </cc2:CalendarExtender> 
                                </div>
                               
                
                                
                 <br />
                   
              
                                 <div>
                    <br /> </div>
               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Button  ID="btnSearch" 
                        runat="server" Height="25px" Text="Search" CssClass="btnexpress" 
        Width="71px" BorderStyle="Dotted" onclick="btnValidate_Click" />
            
        </div>
                  
                
 
  
</asp:Content>